#include<bits/stdc++.h>
using namespace std;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(0);
	int diff[100000]={0};
	int shu=0;
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		if(diff[i/2+i/3+i/5]==0){
			diff[i/2+i/3+i/5]=1;
			shu++;
		}
	}
	cout<<shu;
	return 0;
}